@model WalkingTec.Mvvm.Core.BaseVM
<style>
    a {
        color: #01aaed
    }
</style>
<p>WTM framework supports data authorization of relational table.</p>

<wt:fieldset field-set-style="Simple" title="Define data permissions">
    The data permission of which tables are supported by the system need to be defined in the code. For example, the following code defines that the system needs to set the user role table as a data permission:
    <wt:code title="Program.cs">
public class Program
{
    public static void Main(string[] args)
    {
        BuildWebHost(args).Run();
    }

    public static IWebHost BuildWebHost(string[] args) =&gt;
        WebHost.CreateDefaultBuilder(args)
            .ConfigureServices(x =&gt;
            {
                List&lt;IDataPrivilege&gt; pris = new List&lt;IDataPrivilege&gt;();
                pris.Add(new DataPrivilegeInfo&lt;TestRole&gt;("Testing role", y =&gt; y.RoleName));
                x.AddFrameworkService(dataPrivilegeSettings: pris);
                x.AddLayui();
            })
            .Configure(x =&gt;
            {
                x.UseFrameworkService();
            })
            .Build();

}
    </wt:code>
</wt:fieldset>
<wt:fieldset field-set-style="Simple" title="Configure data permissions">
    <p>The framework provides a system management module, encapsulated in WalkingTec.Mvvm.Admin, which includes the functionality of configuring data permissions. For details, please refer to the data permission management function in the framework management module</p>
</wt:fieldset>

<wt:fieldset field-set-style="Simple" title="Use data permission">
    <p>The configuration of data permissions is stored in ‘DataPrivileges’ table of the framework. When you write your own query statements or stored procedures, you can directly use the data from the table.</p>
    <p>If you use lambda to write query statements, you can use ‘DpWhere’ method provided by the system to simplify the validation of data permissions.</p>
</wt:fieldset>
    <script>
    layui.use('code',function(){layui.code({ about: false })})
    </script>

<script>
  $("#@Model.ViewDivId").parent().css("height", "auto");
</script>
